export interface Event {
  key: string; // 埋点key
  needCommon?: boolean; // 是否需要公共参数
}

// 1.登录页-访问登录页;
export const showLogin = {
  key: 'showLogin',
  needCommon: true
};

// 2.发现页-访问发现页;
export const showDiscovery = {
  key: 'showDiscovery'
};

// 3.商品详情页-访问商品详情页;
export const showSpuDetail = {
  key: 'showSpuDetail'
};

// 4.订单确认页-访问订单确认页;
export const showOrderConfirm = {
  key: 'showOrderConfirm'
};

// 5.我的课程页-访问我的课程页;
export const showCourseList = {
  key: 'showCourseList',
  needCommon: true
};

// 6.课程详情页-访问课程详情页;
export const showCourseDetail = {
  key: 'showCourseDetail'
};

// 7.上课页面-访问上课页面; objectId: lessonId videoPlayType:'live','vod'
export const showClassRoom = {
  key: 'showClassRoom'
};

// 8.我的页面-访问我的页面;
export const showPersonCenter = {
  key: 'showPersonCenter'
};

// 9.编辑个人信息页-访问编辑个人信息页;
export const showPersonalInfo = {
  key: 'showPersonalInfo'
};

// 10.蜜蜂币充值页-访问蜜蜂币充值页;
export const showYutouCoinCharge = {
  key: 'showYutouCoinCharge'
};

// 11.蜜蜂币充值记录页-访问蜜蜂币充值记录页;
export const showYutouCoinChargeRecord = {
  key: 'showYutouCoinChargeRecord'
};

// 12.收货地址页-访问收货地址页;
export const showReceiveAddress = {
  key: 'showReceiveAddress'
};

// 13.联系我们页-访问联系我们页;
export const showContactUs = {
  key: 'showContactUs'
};

// 14.密码设置页-访问密码设置页;
export const showPasswordSet = {
  key: 'showPasswordSet'
};

// 15.系统设置页面-访问系统设置页面;
export const showSetting = {
  key: 'showSetting'
};

// 16.订单结果页-访问订单结果页;
export const showOrderResult = {
  key: 'showOrderResult'
};

// 17.上课-开关麦克风; reason-原因
export const setClassRoomMicrophone = {
  key: 'setClassRoomMicrophone'
};

// 18.上课-开关麦克风结果; reason-原因
export const setClassRoomMicrophoneRes = {
  key: 'setClassRoomMicrophoneRes'
};

// 19.上课-预加载资源结果; netSpeed -下载平均速度 KB/S  playDuration-下载时间ms
export const finishClassRoomPreDownloadVideo = {
  key: 'finishClassRoomPreDownloadVideo'
};

// 20.上课-进入回放; scene 1-重新开始 2-继续播放 objectId-lessonResourceId
export const startWatchClassRoomReplay = {
  key: 'startWatchClassRoomReplay'
};

// 21.上课-正在看回放（每10s上报一次）; objectId-lessonResourceId duration-最大时间
export const watchingClassRoomReplay = {
  key: 'watchingClassRoomReplay'
};

// 22.上课-退出回放; objectId-lessonResourceId
export const endWatchClassRoomReplay = {
  key: 'endWatchClassRoomReplay'
};

// 22.上课-预加载视频; netSpeed -下载平均速度 KB/S
export const preDownloadingClassRoomVideo = {
  key: 'preDownloadingClassRoomVideo'
};

// 23.上课-获取视频链接失败; reason
export const getVideoInClassRoomFailed = {
  key: 'getVideoInClassRoomFailed'
};

// 24.上课-获取未下载完成的视频链接; reason
export const getVideoInClassRoomUnfinished = {
  key: 'getVideoInClassRoomUnfinished'
};

// 25.启动页
export const showLaunch = {
  key: 'showLaunch',
  needCommon: true
};

// 26.视频下载队列缓存-操作队列中的视频失败; reason
export const handleStoreVideoFailed = {
  key: 'handleStoreVideoFailed'
};

// 27.人脸锁定
export const lockFace = {
  key: 'lockFace'
};

// 28.人脸解锁
export const unLockFace = {
  key: 'unLockFace'
};

// 29.请求异常-请求异常es
export const requestError = {
  key: 'requestError'
};

// 30.请求异常-请求时间大于1s
export const requestTimeout = {
  key: 'requestTimeout'
};

// 31.播放器报错
export const videoPlayerError = {
  key: 'videoPlayerError'
};

// 路由页面和埋点的对应关系
export const routeToEvent: { [key: string]: Event } = {
  SpuDetail: showSpuDetail,
  Order: showOrderConfirm,
  Course: showCourseDetail,
  PersonalInfo: showPersonalInfo,
  Charge: showYutouCoinCharge,
  RechargeRecord: showYutouCoinChargeRecord,
  ReceiveAddress: showReceiveAddress,
  Contact: showContactUs,
  PasswordSet: showPasswordSet,
  Setting: showSetting,
  OrderResult: showOrderResult
};
